<template>
		<view class="container">
			<uni-forms ref="form" :rules="{}">
				<uni-forms-item label="用户名" name="">
					<uni-easyinput  v-model="user.username" @change="usernameChange"  placeholder="请输入姓名" />
				</uni-forms-item>
				<uni-forms-item label="密码" name="">
					<uni-easyinput type="password"   v-model="user.password" placeholder="请输入密码" />
				</uni-forms-item>
				<uni-forms-item label="学院" name="">
					<uni-combox  :candidates="user.cities" placeholder="请选择学院" v-model="user.city"></uni-combox>
				</uni-forms-item>
				<uni-forms-item label="专业" name="">
					<uni-combox  :candidates="user.skills" placeholder="请选择专业" v-model="user.skill"></uni-combox>
				</uni-forms-item>
				<uni-forms-item label="电话" name="">
					<uni-easyinput type="tel"   v-model="user.tel" placeholder="请输入电话" />
				</uni-forms-item>
				<uni-forms-item label="姓名" name="">
					<uni-easyinput  v-model="user.name"  placeholder="请输入姓名" />
				</uni-forms-item>
				<uni-forms-item label="邮箱" name="">
					<uni-easyinput type="email"   v-model="user.email" placeholder="请输入邮箱" />
				</uni-forms-item>
				<uni-forms-item label="" name="">
					<button type="primary" @click="register">注册</button>
				</uni-forms-item>
			</uni-forms>
			
		</view>
	</template>
	
	<script>
		export default {
			data() {
				return {
					user:{
						username:'',
						password:'',
						repassword:'',
						introduce:'',
						city:'',
						cities:['清华','北大','武大','湖大'],
						skills:['编程','足球','开车','开飞机'],
						skill:'',
						tel:'',
						email:'',
						name:'',
						adviceAccept:true
					}
				}
			},
			methods: {
				usernameChange(e){
					console.log(e);
				},
				register(e){
					uni.showToast({
						title: ''+this.user.username+'\r'+this.user.age+'\t'
								+this.user.city+'\t'+this.user.datetimesingle+'\t'
								+this.user.introduce+'\t'
								+this.user.hobby+'\t'+this.user.skill+'\t'
								+this.user.adviceAccept,
								
						icon: 'none'
					});
				}
			},
			onLoad: () => {
				uni.onTabBarMidButtonTap(function(e){
					console.log(e)
					
				})
			}
		}
	</script>
	
	<style>
		.container {
			padding: 20px;
			font-size: 14px;
			line-height: 24px;
		}
	</style>